/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-09-23     zylx         first version
 */

#ifndef __CAAMERA_PORT_H__
#define __CAAMERA_PORT_H__

#include <rtconfig.h>
#include <lcd_port.h>

#ifdef BSP_USING_LCD
#define CAMERA_WIDTH            RT_ALIGN(LCD_WIDTH,4)
#define CAMERA_HEIGHT           RT_ALIGN(LCD_HEIGHT,4)
#define CAMERA_BITS_PER_PIXEL   LCD_BITS_PER_PIXEL
#define CAMERA_PIXEL_FORMAT     LCD_PIXEL_FORMAT
#define CAMERA_BUF_SIZE         (2 * (CAMERA_HEIGHT * CAMERA_WIDTH * CAMERA_BITS_PER_PIXEL / 8))
#else
#define CAMERA_WIDTH            240
#define CAMERA_HEIGHT           135
#define CAMERA_BITS_PER_PIXEL   16
#define CAMERA_PIXEL_FORMAT     RTGRAPHIC_PIXEL_FORMAT_RGB565
#define CAMERA_BUF_SIZE         (3 * (CAMERA_HEIGHT * CAMERA_WIDTH * CAMERA_BITS_PER_PIXEL / 8))
#endif  /* BSP_USING_LCD */

#define CAMERA_RST_GPIO_NUM     GET_PIN(D, 12)
#define CAMERA_EN_GPIO_NUM      GET_PIN(A, 15)
#define CAMERA_PWND_GPIO_NUM    GET_PIN(D, 14)

#define CAMERA_IIC_BUS_NAME     "i2c1"
#define CAMERA_IIC_BUS_ADDR     0x30

#endif /* __CAAMERA_PORT_H__ */
